
package com.bluelinelabs.conductor.conductor.internal;

import ohos.aafwk.content.IntentParams;

/**
 * lipeiquan
 *
 * @since 2021-05-06
 */
public class TransactionIndexer {


    public String KEY_INDEX = "TransactionIndexer.currentIndex";


    private int currentIndex = 0;

    public int nextIndex() {
        return ++currentIndex;
    }

    public void saveInstanceState(IntentParams outState) {
        outState.setParam(KEY_INDEX, currentIndex);
    }


    public void restoreInstanceState(IntentParams savedInstanceState) {
        currentIndex = (int) savedInstanceState.getParam(KEY_INDEX);
    }


}
